package cn.ad.server.web.servlet;

import cn.ad.server.common.utils.SpringContextUtils;
import cn.ad.server.web.servlet.v2.RestPathFilter;
import cn.ad.server.biz.internal.AdService;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 * @author dongbin.yu
 * @from 2016-05-18
 * @since V1.0
 * @deprecated 原广告请求处理Servlet框架将不推荐使用，统一采用v2包下的处理方式，请求入口参考{@link RestPathFilter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)}
 */
@Deprecated
public abstract class AbstractBidServlet extends HttpServlet {


	protected final ObjectMapper objectMapper = new ObjectMapper();
	
	protected AdService adService;
	
	@Override
	public void init() throws ServletException {
		// 配置null过滤掉
		adService = SpringContextUtils.getBean(AdService.class);
		objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
		objectMapper.enable(SerializationFeature.CLOSE_CLOSEABLE);

	}

}
